#include <string>
#include <iostream>
#include <vector>

//
//
//
//
class BigInteger
  {
  public:

    BigInteger();
    BigInteger(const BigInteger&);
    BigInteger(BigInteger&&);
    BigInteger& operator=(BigInteger);
    
    BigInteger(long long i_number);
    explicit BigInteger(const std::string& i_str_number);
    
    ~BigInteger();
    
    // binary arithmetic operations 
    BigInteger& operator+=(const BigInteger&);
    BigInteger& operator-=(const BigInteger&);
    BigInteger& operator*=(const BigInteger&);
    BigInteger& operator/=(const BigInteger&);

    // unary arithmetic operations
    BigInteger& operator++();
    BigInteger operator++(int);
    BigInteger& operator--();
    BigInteger operator--(int);

    // unary sign operators
    BigInteger operator-() const;
    BigInteger operator+() const;

    // getter functions
    inline size_t GetDigitNumber() const;
    inline unsigned short GetDigit(size_t i_position) const;

    inline bool IsPositive() const;
    inline bool IsNegative() const;

    std::string ToString() const;

  private:
    std::vector<int> m_digits;
    
    short m_sign;

    static const size_t m_append_lenght = 10;
    static const size_t m_number_base = 10;

    void _Swap(BigInteger&);
  };

// iostream operators overloading
std::ostream& operator<<(std::ostream&, const BigInteger&);
std::istream& operator>>(std::istream&, BigInteger&);

// binary arithmetic operators overloading
BigInteger operator+(BigInteger, const BigInteger&);
BigInteger operator-(BigInteger, const BigInteger&);
BigInteger operator*(BigInteger, const BigInteger&);
BigInteger operator/(BigInteger, const BigInteger&);

// compare operators overloading
bool operator==(const BigInteger&, const BigInteger&);
bool operator!=(const BigInteger&, const BigInteger&);
bool operator< (const BigInteger&, const BigInteger&);
bool operator>( const BigInteger&, const BigInteger&);
bool operator<=(const BigInteger&, const BigInteger&);
bool operator>=(const BigInteger&, const BigInteger&);